package com.ruoyi.storage.service.impl;

import java.util.List;

import com.ruoyi.storage.mapper.WarehouseInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.storage.mapper.WarehouseZoneMapper;
import com.ruoyi.storage.domain.WarehouseZone;
import com.ruoyi.storage.service.IWarehouseZoneService;

/**
 * 库区管理Service业务层处理
 * 
 * @author 庞一恺
 * @date 2025-01-09
 */
@Service
public class WarehouseZoneServiceImpl implements IWarehouseZoneService 
{
    @Autowired
    private WarehouseZoneMapper warehouseZoneMapper;
    @Autowired
    private WarehouseInfoMapper warehouseInfoMapper;

    /**
     * 查询库区管理
     * 
     * @param areaId 库区管理主键
     * @return 库区管理
     */
    @Override
    public WarehouseZone selectWarehouseZoneByAreaId(Integer areaId)
    {
        return warehouseZoneMapper.selectWarehouseZoneByAreaId(areaId);
    }

    /**
     * 查询库区管理列表
     * 
     * @param warehouseZone 库区管理
     * @return 库区管理
     */
    @Override
    public List<WarehouseZone> selectWarehouseZoneList(WarehouseZone warehouseZone)
    {

        return warehouseZoneMapper.selectWarehouseZoneList(warehouseZone.getWarehouseId());
    }

    /**
     * 新增库区管理
     * 
     * @param warehouseZone 库区管理
     * @return 结果
     */
    @Override
    public int insertWarehouseZone(WarehouseZone warehouseZone)
    {

        return warehouseZoneMapper.insertWarehouseZone(warehouseZone);
    }

    /**
     * 修改库区管理
     * 
     * @param warehouseZone 库区管理
     * @return 结果
     */
    @Override
    public int updateWarehouseZone(WarehouseZone warehouseZone)
    {
        return warehouseZoneMapper.updateWarehouseZone(warehouseZone);
    }

    /**
     * 批量删除库区管理
     * 
     * @param areaIds 需要删除的库区管理主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseZoneByAreaIds(Integer[] areaIds)
    {
        return warehouseZoneMapper.deleteWarehouseZoneByAreaIds(areaIds);
    }

    /**
     * 删除库区管理信息
     * 
     * @param areaId 库区管理主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseZoneByAreaId(Integer areaId)
    {
        return warehouseZoneMapper.deleteWarehouseZoneByAreaId(areaId);
    }
}
